﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Search.ascx.cs" Inherits="UserControls_Search" %>

<script type="text/javascript">
    
    function getType()
    {
      var ddl   =   document.getElementById("ddl_Types");   
      var index   =   ddl.selectedIndex;      
      var selValue   =   ddl.options[index].value;  
      var hidden = document.getElementById("tb_Hidder").value = selValue; 
     // var   selText     =   ddl.options[index].text; 
     }  
     function check()
     {
          var keyword = document.getElementById("tb_Search").value;      
          if(keyword == "请输入关键字" || keyword == "")
          {
            return false;   
          }
          return true;
     }

</script>

<div style="float:left">
    <asp:DropDownList ID="ddl_Types" runat="server" DataTextField="TypeName" DataValueField="TypeCode">
        <asp:ListItem></asp:ListItem>
    </asp:DropDownList>
</div>
<form id="sendform" method="post" onsubmit="return check();" action="SearchResultByAll.aspx?type=<%=ddl_Types.SelectedValue.ToString()%>">
<input type="text" name="tb_Search" id="tb1" value="请输入关键字" size="20" />
<input type="text" name="tb_Hidder" id="tb2" style="visibility: hidden" value="" />
<input type="submit" name="btn_SubmitClient" onclick="javascript:getType();" id="bt1"
    value="搜索" />
<%--<asp:TextBox ID="tb_Search"  Text="请输入关键字"></asp:TextBox>
    <asp:Button ID="btn_Search" runat="server" onclick="btn_Search_Click" 
        Text="Button" />--%>
</form>
